<template>
	<view class="fullContent bgf8">
		<view class="bgw pd30" style="margin-bottom: 30upx;">
			<uni-list>
				<uni-list-item class="avatar" title="头像" showArrow clickable>
					<template slot="footer">
						<img v-if="myInfo.avatar" class="avatarImg" :src="baseUrl+myInfo.avatar" mode="widthFix"></img>
						<img v-else class="avatarImg" src="../../static/bg/Myprescription1.png" mode="widthFix"></img>
					</template>
				</uni-list-item>
				<uni-list-item title="姓名" :rightText="myInfo.name"></uni-list-item>
				<uni-list-item title="手机号码" :rightText="myInfo.phone"></uni-list-item>
				<uni-list-item title="所属医馆" :rightText="myInfo.company_title"></uni-list-item>
				<uni-list-item title="所在科室" :rightText="myInfo.keshi"></uni-list-item>
				<uni-list-item class="avatar" title="医师职称">
					<template slot="footer">
						<view class="docSign">
							<img src="../../static/bg/docSign.png" mode=""></img>
							{{myInfo.zhicheng}}
						</view>
					</template>
				</uni-list-item>
			</uni-list>
		</view>
	<!-- 	<view class="bgw  pd30" style="margin-bottom: 30upx;">
			<uni-list>
				<uni-list-item v-if="hasAuth" title="认证信息" rightText="去查看" showArrow clickable @click="goAuthInfo">
				</uni-list-item>
				<uni-list-item v-else class="hasNoData" title="认证信息" rightText="未设置" showArrow clickable @click="goAuthInfo">
				</uni-list-item>
				<uni-list-item v-if="hasAuth2" title="提现账户" rightText="去查看" showArrow @click="setAccount">
				</uni-list-item>
				<uni-list-item v-else class="hasNoData" title="提现账户" rightText="未设置" showArrow @click="setAccount">
				</uni-list-item>
			</uni-list>
		</view> -->
		<view class="bgw  pd30" style="margin-bottom: 30upx;">
			<uni-list>
				<uni-list-item v-if="myInfo.sc" class="avatar" title="专业擅长" :rightText="myInfo.sc" clickable @click="goSetDetail('pro')">
				</uni-list-item>
				<uni-list-item v-else class="hasNoData" title="专业擅长" rightText="您还没有添加任何诊治擅长" showArrow clickable @click="goSetDetail('pro')">
				</uni-list-item>
				<uni-list-item v-if="myInfo.comment" class="avatar" title="个人简介" :rightText="myInfo.comment" clickable @click="goSetDetail('pra')">
				</uni-list-item>
				<uni-list-item v-else class="hasNoData" title="个人简介" rightText="请填写您的个人详细信息" clickable showArrow @click="goSetDetail('pra')">
				</uni-list-item>
			</uni-list>
		</view>
		<!-- <view class="logout bgw">退出账户</view> -->
	</view>
</template>

<script>
	import {
		myInfo
	} from '../../request/api.js'
	export default {
		data() {
			return {
				baseUrl:'',
				myInfo: {
					id:'',
					avatar: "",
					comment: "",
					jiezhen: 0,
					keshi: "",
					name: "",
					phone: "",
					price: "",
					sc: "",
					zhicheng: ""
				}
			};
		},
		onShow() {
			this.baseUrl = getApp().globalData.baseUrlImg;
			this.getMyInfo()
		},
		methods: {
			goSetDetail(type) {
				uni.navigateTo({
					url: '../setDetail/setDetail?type='+type+'&id='+this.myInfo.id
				})
			},
			goAuthInfo() {
				uni.navigateTo({
					url: '../authInfo/authInfo'
				})
			},
			// 获取用户信息
			getMyInfo() {
				myInfo().then(res => {
					this.myInfo = res.data
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	::v-deep .avatar {
		.uni-list-item__content {
			justify-content: center;
		}
	}
	::v-deep .hasNoData{
		.uni-list-item__extra-text{
			color: #9F9F9F;
		}
	}
	::v-deep .uni-list-item__content-title {
		font-size: 28upx;
		color: #414141;
		white-space: nowrap;
	}

	::v-deep .uni-icons {
		padding: 0;
	}

	::v-deep .uni-list-item__container {
		padding-left: 0;
		padding-right: 0;
	}
	::v-deep .uni-list-item__extra-text{
		color: #000000;
		font-size: 28upx;
		width: 500upx;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		text-align: right;
	}
	::v-deep .uni-list--border-top{
		height: 0px;
	}
	.avatarImg {
		width: 96upx;
		height: 96upx;
		border-radius: 50%;
	}
	.docSign{
		width: 188upx;
		height: 54upx;
		border: 1px solid #BC9869;
		opacity: 1;
		border-radius: 28upx;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 28upx;
		
		color: #BC9869;
		img{
			width: 32upx;
			height: 32upx;
			margin-right: 8upx;
		}
	}
	
	.logout{
		height: 100upx;
		font-size: 28upx;
		font-family: Source Han Sans CN;
		font-weight: 400;
		line-height: 100upx;
		color: #414141;
		text-align: center;
	}
</style>

